<% @projects.each do |project| %>
  <%= render :file => 'designers/project_in_show.html', :locals => { :project => project, :designer => @designer} if project.shown?(params[:pay_status]) %>
<% end %>
<script>
  <% if params[:pay_status] == 'paying' or params[:pay_status] == 'paused' %>
    $('print').update('<%= link_to "▶打印", designer_url(:id => @designer.id, :pay_status => params[:pay_status], :format => :print), :class => :base, :target => :_blank %>');
    $('search_bar').hide();
  <% elsif params[:pay_status] == 'payed' %>
    $('print').update("");
    $('search_bar').show();
  <% end %>
  $('stat_started_on').value = '<%= params[:stat][:started_on] %>';
  $('stat_end_on').value = '<%= params[:stat][:end_on] %>';
  $('title').update('<%= @designer.full_name %><%= t params[:pay_status] if params[:pay_status] %>的项目提成');
</script>